import service from '@/utils/request'


/**
 * 登录
 * @param data
 * @returns {*}
 */
export const reqLogin = (data) => {
  return service({
    url: 'auth/login',
    method: 'post',
    data: data
  })
}

/**
 * 获取智能体
 * @returns {*}
 */
export const getIa = () => {
  return service({
    url: 'ia/get',
    method: 'get'
  })
}

export const reqChatList = () => {
  return service({
    url: 'ia/chat-list',
    method: 'get'
  })
}

/**
 * 聊天
 * @param data
 * @returns {*}
 */
export const reqIaChat = (data) => {
  return service({
    url: 'ia/chat',
    method: 'post',
    data,
    donNotShowLoading: true,
  })
}

/**
 * 使用能力
 * @param data
 * @returns {*}
 */
export const usedAbility = (data) => {
  return service({
    url: 'ia/used-ability',
    method: 'post',
    data,
    donNotShowLoading: true,
  })
}

/**
 * 获取能力
 * @returns {*}
 */
export const getAility = (type) => {
  return service({
    url: `ability/get?type=${type}`,
    method: 'get'
  })
}

/**
 * 获取能力列表
 * @returns {*}
 */
export const abilityList = () => {
  return service({
    url: 'ability/list',
    method: 'get'
  })
}

/**
 * 获取能力使用记录
 * @param id
 * @returns {*}
 */
export const getUsedAbilityRecord = (id) => {
  return service({
    url: `ability/used-record/get?id=${id}`,
    method: 'get'
  })
}

export const getUsedAbilityListRecord = () => {
  return service({
    url: 'ability/used-record/list',
    method: 'get'
  })
}

export const clearChat = () => {
  return service({
    url: 'ia/chat-clear',
    method: 'get'
  })
}